﻿@model List<MenuListModel>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN VALIDATION STATES-->
        <div class="portlet box green">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-reorder"></i>@ViewBag.TableTitle
                </div>
                <div class="tools">
                </div>
            </div>
            <div class="portlet-body form">
                <!-- BEGIN FORM-->
                @using (Html.BeginForm(null, null, null, FormMethod.Post, new
                {
                    @id = "sortForm",
                    @class = "form-horizontal",
                    @novalidate = "novalidate",
                    @enctype = "multipart/form-data"
                }))
                {
                    <div class="form-body">
                        @Html.AntiForgeryToken()
                        @Html.Partial("_Tip")
                        @Html.Hidden("result")

                        <div class="form-group">
                            <label class="control-label col-md-3">
                            </label>
                            <div class="col-md-9" id="jstree">
                                @Html.Partial("_SortChild", new ViewDataDictionary { { "List", Model } })
                            </div>
                        </div>

                    </div>
                    <div class="form-actions fluid">
                        <div class="col-md-offset-3 col-md-9">
                            <button type="submit" class="btn green">Submit</button>
                            <button type="button" class="btn default" onclick="location.href='@Url.Action("List")'">Cancel</button>
                        </div>
                    </div>
                }
                <!-- END FORM-->
            </div>
            <!-- END VALIDATION STATES-->
        </div>
    </div>
</div>

@section script{
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/jstree.min.js"></script>
    <script src="~/assets/zrjs/menu/sort.js"></script>
    <script>
        postUrl = '@Url.Action("Sort")';
    </script>
}

@section css{
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/themes/default/style.min.css" />
}
